<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>留言板~</title>
  <script src="https://cdn.jsdelivr.net/npm/babel-polyfill/dist/polyfill.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/jquery"></script>
  <script src="__PUBLIC__/script/common.js" common-data-1="{:U('Mix/dest')}"></script>
  <script src="__PUBLIC__/script/jquery-weui/dist/js/swiper.min.js"></script>

  <link rel="stylesheet" href="__PUBLIC__/script/jquery-weui/dist/css/jquery-weui.css">
  <link rel="stylesheet" href="__PUBLIC__/script/jquery-weui/dist/lib/weui.min.css">
  <link rel="stylesheet" href="__PUBLIC__/styles/base.css">
  <link rel="stylesheet" href="__PUBLIC__/styles/panel_chat1.css">
  <style>
    /* 收缩 */
    #panel_data:checked ~ .weui-cell {
      display: none;
    }
  </style>
  <!-- 共用 -->
  <script>
    // window.from_user_group = `{$from_user_group}`
    window.chat_lccdc_data = `{$chat_lccdc_data}`
    // const fromPHP = `{$from_user_group}`
    // $.toptip(fromPHP)
    window.fromPHP = fromPHP
    sessionStorage.setItem('from_user_group_id', null)
    if (JSON.parse(window.fromPHP).from_user_group_id) {
      sessionStorage.setItem('from_user_group_id', JSON.parse(window.fromPHP).from_user_group_id)
    }
  </script>
  <!-- 渠道专用 -->
  <script>
    window.__init_i_am_qudao = true
    window.qudaoData = `{$new_fom_data}`
  </script>
</head>
<body>
  <div style="display:none;">
    <!-- <input type="hidden" id='getQudaoList' name="获取渠道列表" value="{:U('Chat/ajax_load_bank_list')}"> -->
    <input type="hidden" id='postMessage' name="消息发送" value="{:U('Chat/send_msg')}">
    <input type="hidden" id='getMessage' name="消息拉取" value="{:U('Chat/update_record')} ">
  </div>
  <div class="container">
    <div class="messageContainer">
      <!-- 客户资料区域 -->
      <div class="weui-cells__title"><label for="panel_data" style="display:block;" id='panel_data_title'>点击收起</label></div>
      <div class="weui-cells panel_data" id='panel_data_container' style='font-size:0!important;transition:transform 0.1s;transform-origin:top;'>
        <input type="checkbox" name="不提交，仅用作收缩" id="panel_data">
        <div class="weui-cell">
          <div class="weui-cell__bd">
            <p>标题文字1</p>
          </div>
          <div class="weui-cell__ft">说明文字1</div>
        </div>
        <div class="weui-cell">
          <div class="weui-cell__bd">
            <p>标题文字2</p>
          </div>
          <div class="weui-cell__ft">说明文字2</div>
        </div>
      </div>
      <!-- end 客户资料区域 -->
      <volist name='record_data' id='vo'>
        <if condition="$vo.from_user eq $my_new_fom_data['from_user_group_id']">
        <div class="messageBlock" inori-data-id='{$vo.record_id}'>
          <!-- logo就是logo了，内容是单字 -->
          <div class="person_logo">
            <!--
              main_qudao 评估令渠道
              alt_qudao 公司渠道
              common_qudao_name 共有渠道
              person-id 用来确认修改发送人的，值将会被直接用于表单数据，用于分辨传给谁 下同
             -->
          <div class="name common_qudao_name" person-id='{$vo.q_web_id}'>{$vo.q_web_id|get_web_nick_name}</div>
          </div>
          <div class="message_main_block">
            <!-- 第一行是产品代码加地区,原始ID放在span里边我前端后期处理成随机，要求原始代码不能有字母，我用这个来判断是不是已经处理了 -->
            <div class="person_info"><span class="id" p-uid="{$vo.goods_id}">AA12345678</span>{$vo.web_city_id|re_data_web}</div>
            <!-- 第二行是额度加利息利率 -->
            <div class="person_info_from">{$vo.goods_id|get_min_ed}万-{$vo.goods_id|get_max_ed}万 <span> </span> {$vo.goods_id|get_min_lx}%-{$vo.goods_id|get_max_lx}%</div>
            <!-- 第三行是内容 -->
            <div class="message_content">{$vo.msg}</div>
            <!-- 时间，格式随意 -->
            <div class="message_time">{$vo.time}</div>
          </div>
        </div>
            <else />

          <div class="messageBlock" inori-data-id='{$vo.record_id}'>
           <div class="person_logo">
           <div class="name my_name"><if condition='$vo.role eq 1'>按<else />业</if></div>
           </div>
           <div class="message_main_block">
           <div class="person_name"><if condition='$vo.role eq 1'>按揭员 - {$vo.chat_id|chat_aj_data}<else />业务员</if></div>
           <div class="person_name anjie_from"><if condition='$Think.session.user.p_u_id gt 0'>{$Think.session.user.p_u_id|get_web_f_mesage}<elseif condition='$vo.y_id gt 0'/>{$vo.y_id|get_web_f_mesage}</if></div>
           <div class="his_name"><if condition='$vo.role eq 1'>{$vo.from_user|get_web_nickname_f}<else />{$vo.from_user|get_web_nickname_f_ole}</if></div>
           <div class="message_content">{$vo.msg}</div>
           <div class="message_time">{$vo.time}</div>
           </div>
           </div>
        </if>
      </volist>

    </div>
    <div class="funcContainer" style="background-color: #fff;z-index:10;">
      <!-- <div class="person_logo" id='choseAnother'>
        <input type="text" name="message_person" value="" style="display:none;">
        <div class="send_to_person name common_qudao_name">+</div>
      </div> -->
      <div class="message_input_wrap" id='messageInput' contenteditable="true">
        <!-- <input type="text" name='message' class="message_input" value='你好这是我的一个客户'> -->

      </div>
      <div class="send_btn_wrap">
        <input class="send_btn" id='sendMessage' type="button" value='发送'>
      </div>
      <!-- <div class="shutdown_btn_wrap">
        <input class="shutdown_btn" id='shutdown' type="button" value='测试'>
      </div> -->
    </div>
  </div>
  <script src="__PUBLIC__/script/jquery-weui/dist/js/jquery-weui.min.js"></script>
  <script src="__PUBLIC__/script/panel_chat_qudao1.js?v=1.0.3"></script>
  <script>
    // 收缩动作
    $('#panel_data').on('change', (evt) => {
      if ($('#panel_data').prop('checked')) {
        $('#panel_data_title').text(`点击展开`)
        $('#panel_data_container').css('transform', 'scaleY(0)')
      } else {
        $('#panel_data_title').text(`点击收起`)
        $('#panel_data_container').css('transform', 'scaleY(1)')
      }
    })
  </script>
  <script>
    // 测试用
    $('#shutdown').on('click', (evt) => {
      evt.stopPropagation()
      evt.preventDefault()
      $.toptip(`正在拉取新消息。。。`, 'success')
      getNewMessage()
    })
    // 定时刷新,6000豪秒
    setTimeout(getNewMessage, 60000)
  </script>
</body>
</html>